package com.nuc.bigdata.orm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuc.bigdata.orm.entity.CommodityComments;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;

/**
 * @author JackLuo
 * @date 2019/12/2
 */
public interface CommodityCommentsMapper extends BaseMapper<CommodityComments> {

    /**
     * 查询所有评论并分页
     * @param commodityId 商品唯一标识
     * @param offset 查询起始位置
     * @param length 查询数据量长度
     * @return 包含所有评论的ArrayList
     */
    ArrayList<CommodityComments> listByCommodityId(@Param("commodityId")String commodityId,
                                                   @Param("offset")Long offset,
                                                   @Param("length")Long length);
}
